#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#

Import('CqlIfEnv')

env = CqlIfEnv.Clone()

def MapBuildDir(list):
    return map(lambda x: env['TOP'] + '/' + x, list)

env.Prepend(LIBS=[  'io',
                    'sandesh',
                    'http',
                    'http_parser',
                    'pugixml',
                    'xml',
                    'curl',
                    'process_info',
                    'io',
                    'base',
                    'sandeshvns',
                    'cassandra_cql',
                    'gendb',
                    'cassandra',
                    'ssl',
                    'crypto',
                    'gunit'])

libs = MapBuildDir([
        'xml',
        'base',
        'io',
        'sandesh'])

env.Append(LIBPATH=libs)

env.Prepend(LINKFLAGS=['-Wl,--whole-archive', '-lbase','-Wl,--no-whole-archive' ])
cql_if_test = env.UnitTest('cql_if_test',
                          ['cql_if_test.cc'])

test_suite = [ cql_if_test ]
test = env.TestSuite('cqlif_test_suite', test_suite)
env.Alias('src/contrail-common/database/cassandra/cql:test', test)

flaky_test_suite = []
flaky_test = env.TestSuite('cqlif_flaky_test_suite', flaky_test_suite)
env.Alias('src/contrail-common/database/cassandra/cql:flaky-test', flaky_test)
